package xyz.xuminghai.javafx_learn.scene.effect;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.effect.Reflection;
import javafx.scene.layout.BorderPane;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.stage.Stage;

/**
 * 2023/7/7 0:11 星期五<br/>
 * 镜像效果
 *
 * @author xuMingHai
 */
public class ReflectionApp extends Application {
    private final BorderPane root = new BorderPane();

    public static void main(String[] args) {
        Application.launch(args);
    }

    @Override
    public void init() {
        Text text = new Text("Reflection");
        text.setFont(Font.font(50.0));
        text.setFill(Color.TOMATO);

        Reflection reflection = new Reflection(-20.0, 1.0, 0.5, 0.0);


        text.setEffect(reflection);

        root.setCenter(text);
    }


    public void start(Stage primaryStage) {
        primaryStage.setTitle(getClass().getSimpleName());
        Scene scene = new Scene(root, 800, 600);
        primaryStage.setScene(scene);
        primaryStage.show();
    }
}
